﻿@model IEnumerable<DotNetUniLodz.Models.Event>

<section id="Events">
    <header>
        Wydarzenia
    </header>
    <nav>
        <ul>
            @{
                foreach (var item in Model)
                {
                    var linkText = item.Event_name;
                    if (linkText.Length > 10)
                    {
                        linkText = item.Event_name.Substring(0, 7) + "...";
                    }
                <li>
                    <div class="Box">
                        <span>@item.Event_date.ToShortDateString()</span>
                        @Html.ActionLink(linkText, "Details", "Events", new { id = item.Event_id }, null)
                    </div>
                    <div class="Time">@item.Event_time.ToString("hh':'mm")</div>
                </li> 
                }                
            }
        </ul>
    </nav>
</section>
